package com.godpaper.as9.bussiness.delegates
{
	import com.adobe.cairngorm.business.ServiceLocator;
	import com.godpaper.as9.constants.ServiceInfoList;
	import com.godpaper.as9.managers.ProgressBarManager;
	
	import mx.managers.CursorManager;
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;

	public class UserDelegate extends DelegateBase implements IResponder
	{
		public function UserDelegate(responder:IResponder)
		{
			super(responder);
			this.service = ServiceLocator.getInstance().getRemoteObject(ServiceInfoList.SERVICE_USER);
		}
		
		public function tryLogin(arguments:Object,setBusyCursor:Boolean=true,showProgressBar:Boolean=true):void
		{
			var token:AsyncToken = service.getOperation(ServiceInfoList.OPERATION_TRY_LOGIN).send(arguments);
			token.addResponder(this);
			
			setProgressStatus(setBusyCursor,showProgressBar);
		}
	}
}